<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
use think\Request;

class PersonalPinglun extends IndexController
{
    public function index()
    {
        $mypl = Db::query("select a.title,r.content,r.time,r.art_id,r.id from bbs_article a,bbs_reply r where a.id=r.art_id and r.use_id=".input('session.user.id'));
        $this->assign('myplList', $mypl);



        $plmy = Db::query("select u.icon,u.nickname,a.title,r.content,r.time,r.use_id,r.art_id,r.id from bbs_user u,bbs_article a,bbs_reply r where a.use_id=".input('session.user.id')." and r.art_id=a.id and r.use_id=u.id");
        $this->assign('plmyList', $plmy);

    	
        return view('personal_pinglun/index');
    }



    public function delreply()
    {

        $result = db('reply')->where('id',input('id'))->delete();
        if($result){
            return $this->success('删除成功');
        }else{
            return $this->error('删除失败');
        }
    }





}